Ireland's Energy Path to 2030

Introduction¶

The Irish Government has a target of having an 80% share of electricity generation capacity coming from renewable sources by 2030 to create a more sustainable and resilient energy system for the future.

For this study I collected data from the Sustainable Energy Authority of Ireland (SEAI) comprising the primary energy, final consumption and electricity generated by renewable and non-renewable sources for Irish energy.

Primary energy and final consumption are useful metrics for understanding our current fuel type contributions to power, our dependency on certain fuel types and the environmental impact of our energy system.

In order to assess the countries progress towards it's electricity generation target for renewables I then analyze the composition of electricity generation by fuel type.

Aims of this study¶

The aims of this study are to:

  • Gain an insight in to Irish energy trends including primary and final energy sources and identify the contribution of different energy sources to them.

  • Use data available from SEAI to make a model for predicting what percentage of energy produced will be from renewable energy if the current trends continue.

Data collection¶

Primary energy and final consumption (ktoe) 1990 - 2022 data was obtained from the SEAI energy portal:

https://www.seai.ie/data-and-insights/seai-statistics/energy-data/

Primary Energy Production (ktoe) with fuel type 1990 - 2022 was obtained from the central statistics office portal:

https://data.cso.ie

Electricity generated from different types of fuel 2005 to 2021 was obtained from SEAI key statistics page:

https://www.seai.ie/data-and-insights/seai-statistics/key-statistics/electricity/

Data preprocessing¶

See 'Data_prep.ipynb' notebook in the current directory for more details.

Summary: Data for primary energy from 1990 to 2022 was merged with data from final energy using 'Year' and fuel groups and irrelevant data was dropped.

Data for renewable energy was filtered for renewable energy groups only.

Summed energy aggregates for data electricity generation were added to include total renewable and total non-renewable data for each year in the time series.

Results and Insights¶

Irish energy trends¶

  • Primary energy fuel contributions undergo a transformation from 1990 to 2022 (see Figure 1).

    • Energy sources like peat and coal show a steady decrease over the time series.
    • Natural gas and renewable energy show steady increases over time.
    • Oil shows an initial increase followed by a decrease in contribution to primary energy.

    • Primary energy and final consumption from 1990 to 2022 shows a general upward trend, as would be expected with the economic growth and population growth of Ireland (see Figure 2). The economic downturn in 2008 following the Celtic tiger can be seen as having a significant impact on energy production and consumption. There is also a downward trend around the time of the beginning of the Covd-19 pandemic.

Renewable energy for electricity generation¶

  • Renewable energy sources of various types show a strong growth from 1990 to 2022 with biomass and wind generated energy making up a large portion of this energy (see Figure 3).

  • Comparison of non-renewable energy sources to renewable sources show that an increasing percentage of sum electricity is being generated using renewable sources. In 2021 35% of electricity generated used renewable energy (see Figure 4 for comparison of energy contributions).

Predictions for renewable energy generation in 2030¶

  • Using a regression line modelled using 2005 to 2021 electricity generation indicates that electricity generation capacity will increase by 2030.

    • Using a regression line modelled using 2005 to 2021 renewable energy contribution to electricity generation indicates that if the current trend were to continue renewables would make up 55% of total electricity generation.

note Using a regression line as shown here for prediction of energy production in 2030 is not a very effective way to capture the complexities of possible energy production (R-squared 0.4). There are many variables e.g economic growth etc that can influence this. It can provide an estimate however.

Conclusions¶

  • The Irish recession in 2008 and Covid-19 pandemic at the beginning of 2020 caused an observable difference in both primary and final energy in Ireland.

  • Renewable energy is increasingly important for Irish enery generation. The main contributors currently are biomass and wind generated energy.

  • In order to meet goal of 80% of electricity being generated by renewables there will have to be an increase in the capacity of renewable energy at a rate that is higher than the historical trend from 2005 to 2021. This model for prediction is limited as it only takes historic energy production from 2005 in to account.

Exploratoring overall energy trends¶

Can visualize an overview of primary energy trends and the contribution of different fuel contributions using a barplot with the fuel groups as subcolumns.

In [1]:
# import libraries for data visualization
import pandas as pd # pandas for panel data
import plotly.express as px # plotly for interactive plots
import numpy as np # numpy for creating ranges
import matplotlib.pyplot as plt #plotting using pyplot

# load the data, described in 'data_prep' workbook
energy_summary_df = pd.read_csv("../data/Irish_energy_summary1990_2022.csv")
In [2]:
# create a barplot to visualize different fuel contributions to primary energy

fig = px.bar(energy_summary_df, x="Year", y="Primary Energy", 
             color="Fuel Group",  
             labels={"Year": "Year", "Primary Energy": "Primary Energy (ktoe)"})

# Center the title
fig.update_layout(
    title=dict(
        text="Irish Primary Energy 1990 - 2022",
        font=dict(size=24),
        x=0.5,
        xref="paper"
    )
)

fig.add_annotation(
    text='Figure 1. Irish Primary Energy.',
    xref='paper', yref='paper',
    x=0.5, y=-0.2,
    showarrow=False,
    font=dict(size=14, color='black')
)
fig.show()
In [3]:
# lineplot looking at total primary energy and final energy consumption

# Group data by year and sum the values for 'Primary Energy' and 'Final Consumption'
grouped_data = energy_summary_df.groupby('Year').agg({'Primary Energy': 'sum', 'Final Consumption': 'sum'}).reset_index()

# Create line chart
fig = px.line(grouped_data, x='Year', y=['Primary Energy', 'Final Consumption'], labels={'value': 'Energy (ktoe)'})
fig.update_layout(
    title='Primary energy and final consumption ',
    xaxis_title='Year',
    yaxis_title='Energy (ktoe)',
    legend_title='Type'
)

# add a highlight rectangle for economic downturn 2008 to 2014
fig.add_vrect(
    x0="2008", x1="2014",
    fillcolor="LightSalmon", opacity=0.5,
    layer="below", line_width=0,
)
# add another highlight for covid 2020 starting
fig.add_vrect(
    x0="2020", x1="2021",
    fillcolor="LightSalmon", opacity=0.5,
    layer="below", line_width=0,
)

# Center the title
fig.update_layout(
    title=dict(
        text="Irish Primary Energy and Final Consumption Trend 1990 - 2022",
        font=dict(size=24),
        x=0.5,
        xref="paper"
    )
)

# add annotation to first highlighted year rectangle
fig.add_annotation(x=2008, y=12000,
            text="2008 Economic downturn",
            showarrow=True,
            arrowhead=1,
                  ay = 50)

# add annotation to second highlighted year rectangle
fig.add_annotation(x=2020, y=12000,
            text="2020 Covid-19 pandemic",
            showarrow=True,
            arrowhead=1,
                  ay = 50)


# add caption to figure
fig.add_annotation(
    text='Figure 2. Primary Energy and Final Consumption Trend',
    xref='paper', yref='paper',
    x=0.5, y=-0.2, 
    showarrow=False,
    font=dict(size=14, color='black')
)

fig.show()

Renewable energy goals¶

In [4]:
# load renewable energy data
df_renewable = pd.read_csv("../data/Irish_renewable_energy_summary1990_2022.csv")

# convert ktoe to TWh for reference to some literature, 1 ktoe = 0.01163 TWh
df_renewable['Energy (TWh)'] = df_renewable['VALUE'] * 0.01163

Renewable energy sources 1990 - 2022¶

A look at the different sources of renewable energy and how they contribute to the energy production.

In [5]:
# plot for trend of renewable sources
fig = px.bar(df_renewable, x="Year", y="VALUE", 
             color="Fuel Type", labels={"VALUE": "Enery (ktoe)"})

# Center the title
fig.update_layout(
    title=dict(
        text="Renewable primary energy source contribution 1990 - 2022 ",
        font=dict(size=24),
        x=0.5,
        xref="paper"
    )
)

fig.add_annotation(
    text='Figure 3: Renewable enery sources contribution 1990 - 2022.',
    xref='paper', yref='paper',
    x=0.5, y=-0.2,  
    showarrow=False,
    font=dict(size=14, color='black')
)

fig.show()

Predictive modelling for renewable energy goal¶

Can first look at what percentage of electricity available for consumption is generated by renewables currently. Can then use the trend from 2005 to 2021 to see what the percentage would be in 2030 if the trends remain the same.

In [6]:
# load in the data

# this is electricity available for consumption by end users with fuel types and sources

df_electricity = pd.read_csv("../data/Irish_electricity_generation_sources.csv")
In [7]:
# Create line chart for renewable and non-renewable sources from 2005 - 2021


fig = px.line(df_electricity, x='Year', y=['Renewables', 'Non-renewable sum (ktoe)', 'Sum energy sources (ktoe)'])

fig.update_layout(
    title='Electricity generated by renewable and non-renewable sources 2005 - 2021',
    xaxis_title='Year',
    yaxis_title='Energy (ktoe)',
    legend_title='Energy Source',
)

fig.add_annotation(
    text='Figure 4: Electricity generated by renewable and non-renewable sources 2005 - 2021.',
    xref='paper', yref='paper',
    x=0.5, y=-0.2, 
    showarrow=False,
    font=dict(size=14, color='black')
)

Electricity generation in 2030¶

In [8]:
from sklearn.linear_model import LinearRegression # import linear regression model for prediction of future energy
In [9]:
# will get a warning over 'feature' labelling, but this does not effect the predictive model
import warnings
warnings.filterwarnings('ignore')

regressor_sum = LinearRegression()
regressor_renewable = LinearRegression()

# Fit the model to data for total energy
X = df_electricity[['Year']]
y_sum = df_electricity['Sum energy sources (ktoe)']
regressor_sum.fit(X, y_sum)

# Fit the model to data for renewable energy
X = df_electricity[['Year']]
y_renewable = df_electricity['Renewables']
regressor_renewable.fit(X, y_renewable)


# Check the R-squared value of both models
r_squared_sum = regressor_sum.score(X, y_sum)
print(f"R-squared value for total prediction: {r_squared_sum:.4f}")
r_squared_renewable = regressor_renewable.score(X, y_renewable)
print(f"R-squared value for renewable prediction: {r_squared_renewable:.4f}")


# use first regression line to predict electricity generation in 2030
predicted_2030_total = regressor_sum.predict([[2030]])
print(f"Predicted total electricity generation data for 2030: {predicted_2030_total[0]:2f}(ktoe)")

# use second regression line to predict renewable electricity generation in 2030
predicted_2030_renewable = regressor_renewable.predict([[2030]])
print(f"Predicted renewable electricity generation data for 2030: {predicted_2030_renewable[0]:2f}(ktoe)")


percentage_predict = (predicted_2030_renewable/predicted_2030_total)
percentage_predict = percentage_predict[0] * 100
print(f"Predicted % of renewable energy in total energy generation in 2030 is {percentage_predict:.2f}%")
R-squared value for total prediction: 0.4689
R-squared value for renewable prediction: 0.9430
Predicted total electricity generation data for 2030: 2874.964686(ktoe)
Predicted renewable electricity generation data for 2030: 1567.150196(ktoe)
Predicted % of renewable energy in total energy generation in 2030 is 54.51%
In [10]:
# plot the linear regression lines used for prediction and the predicted values

# Generate future years for prediction
future_years = np.arange(df_electricity['Year'].min(), df_electricity['Year'].max() + 9)
future_years = future_years.reshape(-1, 1)  # Reshape for sci-kit prediction

# Predict values for both models for future years
predicted_sum = regressor_sum.predict(future_years)
predicted_renewable = regressor_renewable.predict(future_years)


# Plot the actual data until 2021
plt.scatter(df_electricity['Year'], df_electricity['Sum energy sources (ktoe)'], label='Actual Total Energy', color='blue')
plt.scatter(df_electricity['Year'], df_electricity['Renewables'], label='Actual Renewable Energy', color='green')

# Plot the trend lines for both models
plt.plot(future_years, predicted_sum, label='Total Energy Trend Line', color='red')
plt.plot(future_years, predicted_renewable, label='Renewable Energy Trend Line', color='orange')

plt.xlabel('Year')
plt.ylabel('Energy (ktoe)')
plt.title('Energy Generation Trends')
plt.legend()
plt.grid(True)
plt.annotate("Figure 5. Energy generation predictions for 2030", xy=(2010, 500), xytext=(2010, -560))
plt.show()